Due to weird and strange JS scoping semantics, if we are in a
callback, "i" won't be captured and when the callback is called,
we'll have the wrong index, causing addImage to be called instead
of updateImage.
https://bugzilla.gnome.org/show_bug.cgi?id=695882
style: this._style,
filename: files[i],
cancellable: this._cancellable,
- onFinished: Lang.bind(this, function(content) {
+ onFinished: Lang.bind(this, function(content, i) {
numPendingImages--;
if (!content) {
this._setLoaded();
this._updateAnimationProgress();
}
- })
+ }, i)
});
}
},